<#assign ctx="${rc.contextPath}">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title></title>
		<style type="text/css">
			body {
				margin-left: 0px;
				margin-top: 0px;
				background-image: url('${ctx}/images/seach_4.gif');
			}
		</style>
		<link href="${ctx}/css/common.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="${ctx}/js/jquery-1.4.4.min.js"></script>
	</head>

	<body>
		<div align="center">
	<form method="post" action="${ctx}/rent/doedit.htm" id="doedit">
	<input type="hidden" name="rent_id" value="${rent.rent_id!""}">
  <table width="100%" height=100% border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height=25 id=location ><div align="left"><img src="${ctx}/images/location_arrow.gif" width="8" height="11" align="absmiddle"> 您的位置：购房/租房&gt;&gt; 查询购房信息&gt;&gt; 未审批购房信息修改</div></td>
    </tr>
     <tr>
      <td valign="top" ><div>
          <table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="2">
                <TBODY>

                  <TR>
                    <TD ><div align="center">
                      <table width="90%"  border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td><fieldset>
                            <legend>申请人信息</legend>
                            <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="2">
                              <TBODY>
                              <TR>
                                  <TD align="right" >产权管理单位</TD>
                                  <TD align="left"> <SELECT name="group_id" id="group_id" size="1", style="width:210px" onchange="setbuildlist(this)">
									   <#if groupList??>
									   		<#list groupList as group>
									   			<#if rent.group_id == group.group_id>
									   				<option selected value="${group.group_id!""}"> ${group.group_name!""} </option>
									   				<#else>
									   					<option value="${group.group_id!""}"> ${group.group_name!""} </option>
									   			</#if>
	                    					</#list>
									   </#if>
											 </SELECT>	
                                    </TD>
                                  <TD align="right" >楼信息</TD>
                                  <TD align="left" ><SELECT name="build_id" id="select-louleixing" size="1", style="width:210px" onchange="setroomlist(this)">
                                    <#if buildList??>
									   		<#list buildList as build>
									   			<#if rent.build_id == build.build_id>
									   				<option selected value="${build.build_id!""}">${build.house_estate!""}-${build.build_no!""}</option>
									   				<#else>
									   					<option value="${build.build_id!""}">${build.house_estate!""}-${build.build_no!""}</option>
									   			</#if>
	                    					</#list>
									   </#if>
                                  </SELECT></TD>
                                </TR>
                                <TR>
                                <TD align="right" >房信息</TD>
                                  <TD align="left" ><SELECT name="room_id" id="room_id" size="1", style="width:210px">
                                    <#if roomList??>
									   		<#list roomList as room>
									   			<#if rent.room_id == room.room_id>
									   				<option selected value="${room.room_id!""}">${room.room_unit!""}-${room.room_no!""}</option>
									   				<#else>
									   					<option value="${room.room_id!""}">${room.room_unit!""}-${room.room_no!""}</option>
									   			</#if>
	                    					</#list>
									   </#if>
                                  </SELECT></TD>
                           	     <TD align="right" >货币补贴</TD>
                           	     <TD align="left" ><SELECT name="rent_bt" size="1", style="width:210px">
                                   <option <@ui.selected "1" rent.rent_bt!"" /> value="1"> 全额享受 </option>
                                   <option <@ui.selected "2" rent.rent_bt!"" /> value="2"> 部分享受 </option>
                                   <option <@ui.selected "0" rent.rent_bt!"" /> value="0"> 未享受 </option>
                                 </SELECT></TD>
                         	     </TR>
                                <TR>
                                  <TD align="right" >姓名</TD>
                                  <TD align="left" ><INPUT type="text" value="${rent.rent_name!""}" name="rent_name" id="rent_name" class="input-text" style="width:200px" size="20">
                                    *</TD>
                                  <TD align="right" > 身份证号　</TD>
                                  <TD align="left" ><INPUT type="text" value="${rent.id_card!""}" name="id_card" id="id_card" class="input-text" style="width:200px" size="20">
*</TD>
                                </TR>
                                <TR>
                                  <TD align="right" >工作单位全称</TD>
                                  <TD align="left" colspan="3"><INPUT type="text" value="${rent.comp_name!""}" name="comp_name" id="comp_name" class="input-text" style="width:680px" size="20">
*</TD>
                                </TR>
                               <TR>
                                  <TD width="90" align="right" > 公积金账号</TD>
                                  <TD align="left" >
                                  <INPUT type="text" value="${rent.fund!""}" name="fund" id="fund" class="input-text" style="width:200px" size="20"></TD>
                                  <TD align="right" > 户籍号 </TD>
                                  <TD align="left" ><INPUT type="text" value="${rent.house_hold!""}" name="house_hold" id="house_hold" class="input-text" style="width:200px" size="20"></TD>
                                </TR>
                           	   <TR>
                           	     <TD align="right" >现任行政职务</TD>
                           	     <TD align="left" ><INPUT type="text" value="${rent.position!""}" name="position" id="position" class="input-text" style="width:200px" size="20"></TD>
                           	     <TD align="right" >行政级别</TD>
                           	     <TD align="left" ><INPUT type="text" value="${rent.position_level!""}" name="position_level" id="position_level" class="input-text" style="width:200px" size="20"></TD>
                         	     </TR>
                           	   <TR>
                                 <TD align="right" >现聘专业职称</TD>
                           	     <TD align="left" ><INPUT type="text" value="${rent.rank!""}" name="rank" id="rank" class="input-text" style="width:200px" size="20"></TD>
                           	     <TD align="right" >职称级别</TD>
                           	     <TD align="left" ><INPUT type="text" value="${rent.rank_level!""}" name="rank_level" id="rank_level" class="input-text" style="width:200px" size="20"></TD>
                         	     </TR>
                           	   <TR>
                                 <TD align="right" >租赁性质</TD>
                           	     <TD align="left" ><SELECT name="rent_type" size="1", style="width:210px">
                                        <option  <@ui.selected "1" rent.rent_type!"" /> value="1"> 廉租租金 </option>
                                        <option <@ui.selected "2" rent.rent_type!"" /> value="2"> 标准租金 </option>
										<option <@ui.selected "3" rent.rent_type!"" /> value="3"> 成本租金 </option>
										<option <@ui.selected "4" rent.rent_type!"" /> value="4"> 市场租金 </option>
										<option <@ui.selected "9" rent.rent_type!"" /> value="9"> 其它 </option>
                                      </SELECT>
								 
								 </TD>
                           	     <TD align="right" >租房价格　</TD>
                           	     <TD align="left" ><INPUT type="text" value="${rent.rent_price!""}" name="rent_price" id="rent_price" class="input-text" style="width:200px" size="20">
                           	       元</TD>
                         	     </TR>
                           	   <TR>
                           	     <TD align="right" >租赁保证金</TD>
                           	     <TD align="left" ><INPUT type="text" value="${rent.rent_bzj!""}" name="rent_bzj" id="rent_bzj" class="input-text" style="width:200px" size="20">
                           	       元</TD>
                           	     <TD align="right" ></TD>
                           	     <TD align="left" ></TD>
                         	     </TR>
								 <tr><td colspan="4" align="right">房源选择需要显示：产权管理单位、房位置、小区名称、楼号、总层数、单元、房号、建筑面积、
								 测绘面积、性质、所在楼层、朝向户型、产权比例、是否成套
								 </td></tr>
                              </TBODY>
                            </TABLE>
                          </fieldset></td>
                        </tr>
                      </table>
                    </div></TD>
                  </TR>
                  <TR>
                    <TD ><div align="center">
                      <table width="90%"  border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td><fieldset>
                            <legend>配偶信息</legend>
                                <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="2">
                                  <TBODY>
                                    <TR> 
                                      <TD width="90" align="right" > 姓名</TD>
                                      <TD align="left" > <INPUT type="text" value="${rent.mate_name!""}" name="mate_name" id="mate_name" class="input-text" style="width:200px" size="20">
*</TD>
                                      <TD align="right" >身份证号</TD>
                                      <TD align="left" ><INPUT type="text" value="${rent.mate_card!""}" name="mate_card" id="mate_card" class="input-text" style="width:200px" size="20">
*</TD>
                                    </TR>
                                    <TR>
                                      <TD align="right" >工作单位全称</TD>
                                      <TD colspan="3" align="left" ><INPUT type="text" value="${rent.mate_comp!""}" name="mate_comp" id="mate_comp" class="input-text" style="width:680px" size="20">
*</TD>
                                    </TR>
                                    <TR> 
                                      <TD  align="right" >公积金账号</TD>
                                      <TD align="left" > <INPUT type="text" value="${rent.mate_fund!""}" name="mate_fund" id="mate_fund" class="input-text" style="width:200px" size="20"></TD>
                                      <TD align="right" >&nbsp;</TD>
                                      <TD align="left" >&nbsp;</TD>
                                    </TR>
                                    <TR>
                                      <TD align="right" >现任行政职务</TD>
                                      <TD align="left" ><INPUT type="text" value="${rent.mate_position!""}" name="mate_position" id="mate_position" class="input-text" style="width:200px" size="20"></TD>
                                      <TD align="right" >行政级别</TD>
                                      <TD align="left" ><INPUT type="text" value="${rent.mate_positionlevel!""}" name="mate_positionlevel" id="mate_positionlevel" class="input-text" style="width:200px" size="20"></TD>
                                    </TR>
                                    <TR>
                                      <TD align="right" >现聘专业职称</TD>
                                      <TD align="left" ><INPUT type="text" value="${rent.mate_rank!""}" name="mate_rank" id="mate_rank" class="input-text" style="width:200px" size="20"></TD>
                                      <TD align="right" >职称级别</TD>
                                      <TD align="left" ><INPUT type="text" value="${rent.mate_ranklevel!""}" name="mate_ranklevel" id="mate_ranklevel" class="input-text" style="width:200px" size="20"></TD>
                                    </TR>
                                    <TR> 
                                      <TD width="90" align="right" ></TD>
                                      <TD align="left" >　</TD>
                                      <TD align="right" >　</TD>
                                      <TD align="right" >&nbsp;                                      </TD>
                                    </TR>
                                  </TBODY>
                                </TABLE>
                          </fieldset></td>
                        </tr>
                      </table>
                      </div></TD>
                  </TR>
                  <TR>
                    <TD ><div align="center">
                      <input name="Submit2" type="button" class="input-button" value="保存修改" onClick="save()">
                      <img src="${ctx}/images/line.gif" width="5" height="15" align="absmiddle">
                      <input name="Submit23" type="button" class="input-button" value="重 填"  onClick="resetgoufang()">
                      <img src="${ctx}/images/line.gif" width="5" height="15" align="absmiddle">
					     <input name="Submit2" type="button" class="input-button" value="不修改返回列表" onClick="history.back()">
                      
                      </div></TD>
                  </TR>
                </TBODY>
              </TABLE></td>
            </tr>
          </table>
          </div>
      </td>
    </tr>
  </table>
	</form>
	<input type="hidden" value="${error!""}" id="errorInfo">
</div>
	</body>
	<script>
	var error = $('#errorInfo').val();
	if (error == '1') {
		alert("修改成功！");
		history.back();
	} else if (error == '0') {
		alert("修改失败，请联系管理员！");
	}
		function save() {
			if ($.trim($('#rent_name').val()) == '') {
				alert('租房人姓名不能为空！');
				return;
			}
			if ($.trim($('#id_card').val()) == '') {
				alert('租房人身份证号不能为空！');
				return;
			}
			if ($.trim($('#comp_name').val()) == '') {
				alert('租房人工作单位不能为空！');
				return;
			}
			if ($.trim($('#mate_name').val()) == '') {
				alert('配偶姓名不能为空！');
				return;
			}
			if ($.trim($('#mate_card').val()) == '') {
				alert('配偶身份证号不能为空！');
				return;
			}
			if ($.trim($('#mate_comp').val()) == '') {
				alert('配偶工作单位不能为空！');
				return;
			}
			$('#doedit').submit();
		}
		
		function resetgoufang() {
			$('#rent_name').val('');
			$('#id_card').val('');
			$('#comp_name').val('');
			$('#fund').val('');
			$('#house_hold').val('');
			$('#position').val('');
			$('#position_level').val('');
			$('#rank').val('');
			$('#rank_level').val('');
			$('#rent_price').val('');
			$('#rent_bzj').val('');
			$('#mate_name').val('');
			$('#mate_card').val('');
			$('#mate_comp').val('');
			$('#mate_fund').val('');
			$('#mate_household').val('');
			$('#mate_position').val('');
			$('#mate_positionlevel').val('');
			$('#mate_rank').val('');
			$('#mate_ranklevel').val('');
		}
		
		function setbuildlist(select) {
			var id = select.value;
			var url = "${ctx}/buy/getBuildList/"+id+".htm";
			var buildsoptions = '';
			var roomsoptions = '';
			$.ajax({
			  type: "POST",
			  url: url,
			   success: function(map){
			   var builds = [];
			   var roomsfffff = [];
			   if (map.buildList) {
			   	   var builds = map.buildList;
			   }
			   if (map.roomList) {
			   	   roomsfffff = map.roomList;
			   }
			   	  var builds = map.buildList;
			     for (var i = 0; i < builds.length; i++) {
			     	if (i == 0) {
			     		buildsoptions += '<option selected value="' + builds[i].build_id + '">' + builds[i].house_estate + '-' + builds[i].build_no + '</option>';
			     	} else {
			     		buildsoptions += '<option value="' + builds[i].build_id + '">' + builds[i].house_estate + '-' + builds[i].build_no + '</option>';
			     	}
			     }
			   	  
			     for (var i = 0; i < roomsfffff.length; i++) {
			     	if (i == 0) {
			     		roomsoptions += '<option selected value="' + roomsfffff[i].room_id + '">' + roomsfffff[i].room_unit + '-' + roomsfffff[i].room_no + '</option>';
			     	} else {
			     		roomsoptions += '<option value="' + roomsfffff[i].room_id + '">' + roomsfffff[i].room_unit + '-' + roomsfffff[i].room_no + '</option>';
			     	}
			     }
			     $('#select-louleixing').html(buildsoptions);
			     $('#room_id').html(roomsoptions);
			   }

			});
		}
		
		function setroomlist(select) {
			var id = select.value;
			var options = '';
			$.ajax({
			  type: "POST",
			  url: "${ctx}/buy/getRoomList/"+id+".htm",
			   success: function(list){
			     for (var i = 0; i < list.length; i++) {
			     	if (i == 0) {
			     		options += '<option selected value="' + list[i].room_id + '">' + list[i].room_unit + '-' + list[i].room_no + '</option>';
			     	} else {
			     		options += '<option value="' + list[i].room_id + '">' + list[i].room_unit + '-' + list[i].room_no + '</option>';
			     	}
			     }
			     $('#room_id').html(options);
			   }

			});
		}
	</script>
</html>